package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.Fluids;




public class FluidsDao extends IbatisDao{
	
	public List selectFluids() throws SQLException {
		List selectFluids = null;
			selectFluids =getSqlMap().queryForList("SELECT_ALL_FLUIDS", null);
		return selectFluids;
	}

	public int deleteFluids(Fluids fluids) throws SQLException{
		return (int) getSqlMap().delete("DELETE_FLUIDS", fluids);
	}
	
	public int updateFluids(Fluids fluids) throws SQLException{
		return (int) getSqlMap().update("UPDATE_FLUIDS", fluids);
	}
	
	public Fluids insertFluids(Fluids fluids) throws SQLException{
		return (Fluids) getSqlMap().insert("INSERT_FLUIDS", fluids);
	}

	public Fluids insertFluidsType(Fluids fluids) throws SQLException {
		return (Fluids) getSqlMap().insert("INSERT_FLUIDS_TYPE",fluids);
	}
	
	public List selectFluidsType() throws SQLException {
		return getSqlMap().queryForList("SELECT_ALL_FLUIDS_TYPE", null);
	}
	
		
	public static void main (String args[]) throws SQLException{
		Fluids fluids;
		fluids = new Fluids();
		fluids.setNotes("Coba dari Main");
		new FluidsDao().insertFluids(fluids);
		}
	
}